package org.example.day20240829Calendar;

import java.math.BigInteger;
import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String num = scanner.nextLine();
        BigInteger inputBig = new BigInteger(num);
        BigInteger gun = new BigInteger("1");
        int count = 1;
        while (true){
            gun = gun.multiply(BigInteger.TEN).add(BigInteger.ONE);
            count++;
            if(gun.mod(inputBig).equals(BigInteger.ZERO)){
                break;
            }
        }
        System.out.println(gun.divide(inputBig)+" "+count);
    }
}
